package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售实体类
 * @author Zchaolin
 * @version 1.0
 * @created 29-7月-2022 9:34:37
 */
@TableName("t_sell")
public class SellBean {

	/**
	 * 编号
	 */
	@TableId(value = "pk_sellId",type = IdType.AUTO)
	private Integer id;
	/**
	 * 销售员
	 */
	@TableField("s_user")
	private String salesperson;
	/**
	 * 销售日期
	 */
	@TableField("s_date")
	private LocalDate date = LocalDate.now();
	/**
	 * 地址
	 */
	@TableField("s_address")
	private String address;
	/**
	 * 销售明细集合
	 */
	@TableField(exist = false)
	private List<SellInfoBean> sellInfoList;
	/**
	 * 销售总金额
	 */
	@TableField("s_totalPrice")
	private Integer totalPrice;
	/**
	 * 所属客户编号
	 */
	@TableField("fk_customerId")
	private Integer customerId;
	/**
	 * 所属客户
	 */
	@TableField(exist = false)
	private CustomerBean customerBean;

	public SellBean(){

	}

	public SellBean(String salesperson, String address, Integer totalPrice) {
		this.salesperson = salesperson;
		this.address = address;
		this.totalPrice = totalPrice;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSalesperson() {
		return salesperson;
	}

	public void setSalesperson(String salesperson) {
		this.salesperson = salesperson;
	}

	public LocalDate getDate() {
		return date;
	}

	public void setDate(LocalDate date) {
		this.date = date;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public List<SellInfoBean> getSellInfoList() {
		return sellInfoList;
	}

	public void setSellInfoList(List<SellInfoBean> sellInfoList) {
		this.sellInfoList = sellInfoList;
	}

	public Integer getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Integer totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	public CustomerBean getCustomerBean() {
		return customerBean;
	}

	public void setCustomerBean(CustomerBean customerBean) {
		this.customerBean = customerBean;
	}

	@Override
	public String toString() {
		return "SellBean{" +
				"id=" + id +
				", salesperson='" + salesperson + '\'' +
				", date=" + date +
				", address='" + address + '\'' +
				", sellInfoList=" + sellInfoList +
				", totalPrice=" + totalPrice +
				", customerId=" + customerId +
				", customerBean=" + customerBean +
				'}'+"\n";
	}
}